<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: csnf
  Date: 2025/1/2
  Time: 9:34
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>


<html>
<head>
    <title>Title</title>
</head>
<body>

<form action="getOrderByOrder">
    <input type="text" name="orderCode" placeholder="订单编号" value="${o.orderCode}">
<%--    <select name="orderStste">--%>
<%--        <option value="${o.orderState}">${o.orderState}</option>--%>
<%--        <option value="">所有</option>--%>

<%--        <option></option>--%>
<%--    </select>--%>
    <input type="text" name="orderState" placeholder="订单状态" value="${o.orderState}">
    <input type="submit" value="查询">
</form>

<table border="1">
    <tr>
        <th>订单编号</th>
        <th>收货人</th>
        <th>总金额</th>
        <th>应付金额</th>
        <th>订单状态</th>
        <th>支付状态</th>
        <th>发货状态</th>
        <th>支付方式</th>
        <th>配送方式</th>
        <th>下单时间</th>
        <th>操作</th>
    </tr>
  <c:forEach items="${Orders}" var="order">
    <tr>
        <td>${order.orderCode}</td>
        <td>${order.customer}</td>
        <td>${order.price}</td>
        <td>${order.payPrice}</td>
        <td>${order.orderState}</td>
        <td>${order.payState}</td>
        <td>${order.shipState}</td>
        <td>
            <c:if test="${order.payType==1}">支付宝</c:if>
            <c:if test="${order.payType==0}">微信</c:if>
            <c:if test="${order.payType==12}">银行卡</c:if>
        </td>
        <td>${order.deliveType}</td>
        <td>
            <fmt:formatDate value="${order.createTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
        </td>
        <td><a href="javascript:void(0)" onclick="del(${order.orderId})">删除</a></td>
    </tr>
  </c:forEach>
</table>
<script>
    function del(orderId) {
        if(confirm("确定删除吗？")){
            location.href="deleteOrder?orderId="+ orderId;
        }
    }
</script>
</body>
</html>
